use serde::Deserialize;

#[derive(Debug, Deserialize, Clone)]
pub struct Settings {
    pub server_host: String,
    pub server_port: u16,
    pub rust_env: Option<String>,
    pub rust_log: Option<String>,
    pub database_url: Option<String>,
    pub redis_url: Option<String>,
    pub jwt_secret: Option<String>,
    pub jwt_expires_in: Option<u64>,
    pub worker_threads: Option<usize>,
    pub max_connections: Option<usize>,
}

impl Default for Settings {
    fn default() -> Self {
        Self {
            server_host: "127.0.0.1".into(),
            server_port: 3000,
            rust_env: Some("development".into()),
            rust_log: Some("info".into()),
            database_url: None,
            redis_url: None,
            jwt_secret: None,
            jwt_expires_in: Some(60 * 60 * 24 * 7),
            worker_threads: None,
            max_connections: Some(1000),
        }
    }
}